using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db.Hr.Attendance.Rule;
using HengTong.Model.Db.Hr.Attendance;


namespace HengTong.ViewModel.Hr.SysAttendanceSubsidyRuleVms
{
    public partial class SysAttendanceSubsidyRuleTemplateVm : BaseTemplateVM
    {
        [Display(Name = "规则名称")]
        public ExcelPropety NameExcel = ExcelPropety.CreateProperty<SysAttendanceSubsidyRule>(x => x.Name);
        [Display(Name = "规则类型")]
        public ExcelPropety RuleTypeExcel = ExcelPropety.CreateProperty<SysAttendanceSubsidyRule>(x => x.RuleType);
        [Display(Name = "开始日期")]
        public ExcelPropety EffectiveStartDateExcel = ExcelPropety.CreateProperty<SysAttendanceSubsidyRule>(x => x.EffectiveStartDate);
        [Display(Name = "结束日期")]
        public ExcelPropety EffectiveEndDateExcel = ExcelPropety.CreateProperty<SysAttendanceSubsidyRule>(x => x.EffectiveEndDate);
        [Display(Name = "是否启用")]
        public ExcelPropety IsEnabledExcel = ExcelPropety.CreateProperty<SysAttendanceSubsidyRule>(x => x.IsEnabled);
        [Display(Name = "备注")]
        public ExcelPropety RemarkExcel = ExcelPropety.CreateProperty<SysAttendanceSubsidyRule>(x => x.Remark);
        [Display(Name = "启用出勤时间限制")]
        public ExcelPropety AttendanceTimeConditionEnabledExcel = ExcelPropety.CreateProperty<SysAttendanceSubsidyRule>(x => x.AttendanceTimeConditionEnabled);
        [Display(Name = "最小出勤时间(小时)")]
        public ExcelPropety MinAttendanceHoursExcel = ExcelPropety.CreateProperty<SysAttendanceSubsidyRule>(x => x.MinAttendanceHours);
        [Display(Name = "启用签到时间限制")]
        public ExcelPropety CheckinTimeConditionEnabledExcel = ExcelPropety.CreateProperty<SysAttendanceSubsidyRule>(x => x.CheckinTimeConditionEnabled);
        [Display(Name = "签到开始基准日")]
        public ExcelPropety CheckinStartDayOffsetExcel = ExcelPropety.CreateProperty<SysAttendanceSubsidyRule>(x => x.CheckinStartDayOffset);
        [Display(Name = "签到开始时间")]
        public ExcelPropety CheckinStartTimeExcel = ExcelPropety.CreateProperty<SysAttendanceSubsidyRule>(x => x.CheckinStartTime);
        [Display(Name = "签到结束基准日")]
        public ExcelPropety CheckinEndDayOffsetExcel = ExcelPropety.CreateProperty<SysAttendanceSubsidyRule>(x => x.CheckinEndDayOffset);
        [Display(Name = "签到结束时间")]
        public ExcelPropety CheckinEndTimeExcel = ExcelPropety.CreateProperty<SysAttendanceSubsidyRule>(x => x.CheckinEndTime);
        [Display(Name = "启用签出时间限制")]
        public ExcelPropety CheckoutTimeConditionEnabledExcel = ExcelPropety.CreateProperty<SysAttendanceSubsidyRule>(x => x.CheckoutTimeConditionEnabled);
        [Display(Name = "签出开始基准日")]
        public ExcelPropety CheckoutStartDayOffsetExcel = ExcelPropety.CreateProperty<SysAttendanceSubsidyRule>(x => x.CheckoutStartDayOffset);
        [Display(Name = "签出开始时间")]
        public ExcelPropety CheckoutStartTimeExcel = ExcelPropety.CreateProperty<SysAttendanceSubsidyRule>(x => x.CheckoutStartTime);
        [Display(Name = "签出结束基准日")]
        public ExcelPropety CheckoutEndDayOffsetExcel = ExcelPropety.CreateProperty<SysAttendanceSubsidyRule>(x => x.CheckoutEndDayOffset);
        [Display(Name = "签出结束时间")]
        public ExcelPropety CheckoutEndTimeExcel = ExcelPropety.CreateProperty<SysAttendanceSubsidyRule>(x => x.CheckoutEndTime);
        [Display(Name = "计算方式")]
        public ExcelPropety CalculationTypeExcel = ExcelPropety.CreateProperty<SysAttendanceSubsidyRule>(x => x.CalculationType);
        [Display(Name = "固定金额")]
        public ExcelPropety FixedAmountExcel = ExcelPropety.CreateProperty<SysAttendanceSubsidyRule>(x => x.FixedAmount);
        [Display(Name = "计算公式")]
        public ExcelPropety CalculationFormulaExcel = ExcelPropety.CreateProperty<SysAttendanceSubsidyRule>(x => x.CalculationFormula);
        [Display(Name = "上限金额")]
        public ExcelPropety MaxAmountExcel = ExcelPropety.CreateProperty<SysAttendanceSubsidyRule>(x => x.MaxAmount);
        [Display(Name = "下限金额")]
        public ExcelPropety MinAmountExcel = ExcelPropety.CreateProperty<SysAttendanceSubsidyRule>(x => x.MinAmount);
        public ExcelPropety ShiftExcel = ExcelPropety.CreateProperty<SysAttendanceSubsidyRule>(x => x.ShiftId);

	    protected override void InitVM()
        {
            ShiftExcel.DataType = ColumnDataType.ComboBox;
            ShiftExcel.ListItems = DC.Set<SysAttendanceShift>().GetSelectListItems(Wtm, y => y.Name);
        }

    }

    public class SysAttendanceSubsidyRuleImportVm : BaseImportVM<SysAttendanceSubsidyRuleTemplateVm, SysAttendanceSubsidyRule>
    {

    }

}
